<template>
  <el-form :label-position="labelPosition" label-width="80px" :model="formLabelAlign">
    <el-form-item label="名称">
      <el-input v-model="formLabelAlign.sName"></el-input>
    </el-form-item>
    <el-form-item label="仓库描述">
      <el-input v-model="formLabelAlign.sDesc"></el-input>
    </el-form-item>
    <el-form-item label="地址">
      <el-input v-model="formLabelAlign.sAddress"></el-input>
    </el-form-item>

    <el-form-item>
      <el-button type="primary" @click="onSubmit">提交</el-button>
      <el-button>取消</el-button>
    </el-form-item>
  </el-form>
</template>

<script>
export default {
  name: "Add",
  data() {
    return {
      labelPosition: 'right',
      formLabelAlign: {
        sName: '',
        sDesc: '',
        sAddress: ''
      }
    };
  },
  methods:{
    onSubmit(){
      var vm = this
      this.axios({
        method:"POST",
        url:"/api/store/insert",
        data:{
          code:vm.formLabelAlign.sName,
          name:vm.formLabelAlign.sDesc,
          address:vm.formLabelAlign.sAddress
        }
      }).then(function (res){
        if(res.data.code == 200){
          vm.$message(res.data.msg)
        }else{
          vm.$message(res.data.msg)
        }
      })
    }
  }
}
</script>

<style scoped>

</style>
